#!/usr/bin/env python
# -*- coding: UTF-8 -*-

from twisted.web import client
from twisted.internet import reactor
import sys

def printPage(data):
    print data
    reactor.stop( )

def printError(failure):
    print >> sys.stderr, "Error:", failure.getErrorMessage( )
    reactor.stop( )

client.getPage("http://www.google.com/").addCallback(printPage).addErrback(printError)
reactor.run( )
